﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using BCCommon.Enums;

namespace BCEntity.TMS.NotificationMessageRecord
{
    /// <summary>
    /// 通知消息记录
    /// </summary>
    public class NotificationMessageRecordEntity
    {
        /// <summary>
        /// 通知消息Id
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long NotificationMessageId { get; set; }

        /// <summary>
        /// 通知标题
        /// </summary>
        public string NotificationTitle { get; set; }

        /// <summary>
        /// 工作流类型
        /// </summary>
        public string BusinessType { get; set; }

        /// <summary>
        /// 通知内容
        /// </summary>
        public string NotificationContent { get; set; }

        /// <summary>
        /// 通知类型，参见 <see cref="NotificationMessageRecordType"/>。
        /// </summary>
        public string NotificationType { get; set; }

        /// <summary>
        /// 通知参数
        /// </summary>
        public string NotificationParameters { get; set; }

        /// <summary>
        /// 接收者
        /// </summary>
        public long? AdminId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 相关记录Id
        /// </summary>
        public long RelatedRecordId { get; set; }

        /// <summary>
        /// 是否已读
        /// </summary>
        public bool IsRead { get; set; }

        /// <summary>
        /// 读取时间
        /// </summary>
        public DateTime? ReadTime { get; set; }

        /// <summary>
        /// 接收者姓名
        /// </summary>
        [NotMapped]
        public string FullName { get; set; }

        /// <summary>
        /// 已处理
        /// </summary>
        public bool IsHandled { get; set; }

        /// <summary>
        /// 处理时间
        /// </summary>
        public DateTime? HandledTime { get; set; }

        /// <summary>
        /// 处理备注
        /// </summary>
        public string HandledRemark { get; set; }

        /// <summary>
        /// 接收者用户ID
        /// </summary>
        public long? UserId { get; set; }

        /// <summary>
        /// 接收者用户名称
        /// </summary>
        [NotMapped]
        public string UserName { get; set; }
    }
}
